package application.common.ui;

import application.common.util.RouteUtil;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Modality;
import javafx.stage.Stage;
import javafx.stage.StageStyle;

public class FaultBoxDialog {

	public Stage mainStage;
	private final Stage stage = new Stage();

	public FaultBoxDialog() {
		this.mainStage = RouteUtil.mainStage;
		initGUI();
	}

	public void initGUI() {
		stage.initOwner(mainStage);
		stage.initModality(Modality.WINDOW_MODAL);
		stage.initStyle(StageStyle.UNDECORATED);
		try {
			Parent root = FXMLLoader.load(getClass().getResource("/application/common/ui/fxml/FaultBoxView.fxml"));
			Scene scene = new Scene(root);
			scene.getStylesheets().add(getClass().getResource("/application/application.css").toExternalForm());
			stage.setScene(scene);
			stage.show();
		} catch (Exception e) {
		}
	}

	public void close() {
		stage.close();
	}
}
